import { getItem, setItem } from '@/utils/storage'
import { LANGUAGE } from '@/constant'
export default {
  namespaced: true,
  state: () => ({
    sidebarOpen: true,
    language: getItem(LANGUAGE) || 'zh'
  }),
  mutations: {
    triggerSidebarOpen(state) {
      state.sidebarOpen = !state.sidebarOpen
    },
    setLanguage(state, lang) {
      setItem(LANGUAGE, lang)
      state.language = lang
    }
  }
}
